Do you want to install Mozilla Firefox as a DEB package on Ubuntu 22.04 LTS (and above), not use snap app?

In this guide I show you how to do that, installing Firefox as a DEB on Ubuntu by adding the official Mozilla APT repository and preventing the Snap from being reinstalled.

Firefox has been Ubuntu’s default browser since the distro first appeared. For most of that time it was provided as a DEB, with new releases of the browser needing to be packaged by Ubuntu devs (with connections to Mozilla) first.

In 2021 Ubuntu switched a Firefox snap on new versions of the distro, with Canonical (who make Ubuntu) adding that Mozilla requested the change to allow them to take control of the package, integrate it in to their build system and get updates out to users faster.

You may be thinking: “I can just run sudo apt install firefo, right?”.

No; you cannot. The Firefox DEB package in the Ubuntu repos is not the browser but a ‘transition package’ – a small hook that reinstalls the Firefox Snap (this allows users on pre-snap Ubuntu releases upgrade, this ensures they get the snap).

The Firefox DEB in the Ubuntu repos is a dummy package that installs the Snap build…

Snap apps have plenty of benefits, like improved security, faster access to updates, options to “undo” updates and revert back to an older build, no dependency issues, and more.

But their integration isn’t flawless, and their appeal isn’t universal.

Depending on the kind of app some features may not work in a sandbox; system integration may be affected; startup times may be slower; and automatic background updates can result in issues.

Workarounds, fixes, and ways to mitigate issues with snaps exist. For example, Canonical added new terminal commands to let users pause automatic updates for a set duration. But the fact people need research to learn how to do those things isn’t ideal.

You cam here to learn how to replace the Firefox snap with a Firefox DEB, so let’s get to it.

Installing Firefox via Apt (Not Snap)

Graphic shows DEB icon with a tick, Firefox browser logo in the center and and a Snap package icon with a cross.
Snap isn’t the only way to get Firefox in Ubuntu

Mozilla has a dedicated APT repo for Debian-based distros (like Ubuntu). This packages the latest stable release of Firefox as a DEB package. The repo is fairly new, going live with the release of Firefox 122 in January 2024 – but is already very popular.

You can add the Mozilla APT repo to Ubuntu using the command line (this is the way Mozilla recommends).

You can add it using a GUI (i.e., no commands) but it is a lengthy process, easier to ‘mess up’, and something I won’t be covering in this post.

Note: if you previously added the Mozilla Team PPA to install a Firefox Deb package you should disable or remove the PPA to avoid package conflicts.

Plus, adding APT repo is only half of the process. You will need to ‘pin’ the Firefox DEB package to prevent Ubuntu from reinstalling its transition package (which reinstalls the Firefox snap).

Before continuing be sure to make a backup or export of important browser settings, bookmarks, data, etc., from your existing Firefox installation.

Step 1: Uninstall the Firefox Snap:

sudo snap remove firefox

Step 2: Create an APT keyring (if one doesn’t already exist):

sudo install -d -m 0755 /etc/apt/keyrings

Step 3: Import the Mozilla APT repo signing key (if wget is missing, install it first):

wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null

Step 4: Add the Mozilla signing key to your sources.list:

echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null

Step 5: Set the Firefox package priority to ensure Mozilla’s DEB is always preferred. If you don’t do this the Ubuntu transition package will be reinstalled, and you’ll have the Firefox snap:

echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000

Package: firefox*
Pin: release o=Ubuntu
Pin-Priority: -1' | sudo tee /etc/apt/preferences.d/mozilla

Step 6: Finally, use APT to remove Ubuntu’s pretend Firefox DEB (if still present) and installed the real-deal from Mozilla’s repository:

sudo apt update && sudo apt remove firefox
sudo apt install firefox

Step 7 (Optional): To use a localised version of Firefox (i.e., see the UI in a language other than American English) you need to install the corresponding language package. For example, to install French language support run:

sudo apt install firefox-l10n-fr

A list of all available language packs (listing the package name you need to install) can be seen by running the apt-cache search firefox-l10n command.

Once the repo has been set up and you’ve installed Firefox from it you can go ahead and open it. Open the app picker/menu on your Ubuntu (or flavour), click the Mozilla Firefox icon, and the non-Snap Firefox build, and you can continue on

Be sure to pin the icon to the Ubuntu Dock (or equivalent if you’re using an Ubuntu flavour) for easier access.

Sidenotes…

Do not remove the Firefox snap if you don’t need to. If you’re not experiencing issues with it, don’t have a specific reason/need for a non-Snap build, just keep using it.

And even if you do have issue the snap is being improved all the time. System integration issues with the Firefox snap package (like the one affecting 3rd-party password managers) are being worked on by Ubuntu developers. Hang tight for a solution.

Otherwise, if you’re certain you want the DEB version, now you know how to get it.